Steinhaus–Johnson–Trotter algorithm